package com.thinking.kafkaTest;

import java.util.Date;
import java.util.Map;

import org.apache.storm.task.OutputCollector;
import org.apache.storm.task.TopologyContext;
import org.apache.storm.topology.OutputFieldsDeclarer;
import org.apache.storm.topology.base.BaseRichBolt;
import org.apache.storm.tuple.Tuple;

public class JsonBolt extends BaseRichBolt {
	private static final long serialVersionUID = 1L;
	    private OutputCollector collector;
	    
	public void execute(Tuple tuple ) {
		 String spanDataJson = tuple.getString(0);
	     System.out.println("source data:{}--"+spanDataJson);
	       // this.collector.emit(tuple, values);
	        this.collector.ack(tuple);
		
	}

	  public void prepare(Map stormConf, TopologyContext context,
	            OutputCollector collector) {
		   this.collector = collector;
		
	}

	 public void declareOutputFields(OutputFieldsDeclarer declarer) {
	    //    declarer.declare(this.fields);
	    }

}
